package samsung.other;

import java.util.Objects;

/**
 * Class describe a part of place that some country have in current area.
 *
 * @author Vitaliy Muzalevskiy
 */
public class CountryArea {
    
    private final Position downLeftPoint;
    private final Position upRightPoint;

    public CountryArea(Position downLeftPoint, Position upRightPoint) {
        this.downLeftPoint = downLeftPoint;
        this.upRightPoint = upRightPoint;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 61 * hash + Objects.hashCode(this.downLeftPoint);
        hash = 61 * hash + Objects.hashCode(this.upRightPoint);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final CountryArea other = (CountryArea) obj;
        if (!Objects.equals(this.downLeftPoint, other.downLeftPoint)) {
            return false;
        }
        if (!Objects.equals(this.upRightPoint, other.upRightPoint)) {
            return false;
        }
        return true;
    }

    public Position getDownLeftPoint() {
        return downLeftPoint;
    }

    public Position getUpRightPoint() {
        return upRightPoint;
    }

    @Override
    public String toString() {
        return "CountryArea{" + "downLeftPoint=" + downLeftPoint
                + ", upRightPoint=" + upRightPoint + '}';
    }    
    
}
